package com.myidis.servlet;

import com.myidis.entity.IndexCombination;
import com.myidis.mapper.IndexCombinationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IndexCombinationServlet {
    @Autowired
    private IndexCombinationMapper indexCombinationMapper;

    public List<IndexCombination> all(){
        return indexCombinationMapper.all();
    }

    public int add(IndexCombination add){
        return indexCombinationMapper.insert(add);
    }

    public int update(IndexCombination upd){
        return indexCombinationMapper.update(upd);
    }

    public int delete(IndexCombination del){
        return indexCombinationMapper.delete(del.getName());
    }
}
